# coding=utf-8

class Employee:
    '''
    this is a test demo calss
    '''
    classstr = 'it is a test class'

    def __init__(self, name, pay):
        self.name = name
        self.pay = pay

    def hello(self):
        '''
        say hello
        :param self:
        :return:
        '''

        print self.name
        print 'say hello'


import employee

worker1 = employee.Employee('xiaoming', 10000)
print type(worker1)
worker1.hello()
print worker1.classstr
print '-' * 10
worker2 = employee.Employee('zhangqiang', 10000)
worker2.hello()
print '-' * 10
print "worker1 has attr 'classstr':", hasattr(worker1, "classstr")
value = getattr(worker1, "classstr")
print "worker1 attr 'classstr' value:", value
setattr(worker1, "classstr", "new attr value")
print "worker1 attr 'classstr' value:", getattr(worker1, "classstr")
delattr(worker1, "classstr")
setattr(worker1, "classstr", value)
print "worker1 attr 'classstr' value:", getattr(worker1, "classstr")
print '-' * 10
print employee.Employee.__dict__
print employee.Employee.__doc__
print employee.Employee.__module__
print employee.Employee.__bases__
